<#include '/pages/taglib/core.ftl'>
<#include '/pages/taglib/common.ftl'>
<#assign tiny = Parameters.tiny?default('true') == 'true'>

<@form id="sysLogForm" name="sysLogForm" action="${fn.linkModelNoBase('com.espirit.common.SysLog','add')}">
	<style type="text/css">
		#sysLogForm .sysLog {
			border: 1px solid #CCCCCC;
			height: 200px;
			/*min-width: 1250px;
			max-width: 1250px;*/
			padding: 2px 2px 1px;
			overflow-x: hidden;
		    overflow-y: auto;
		}
		#sysLogForm .sysLog.tiny {
			height: 74px;
			min-width: 100px;
		}
		
		#sysLogForm .sysLogInput {
			height: 23px;
			z-index: 2;
			padding: 1px 0 2px;
			position: relative;
		}
		#sysLogForm .jchildContainer0 .sysLogInput{
			position: relative;
		}
	
		#sysLogForm .sysLogInput .j-form-item .label {
		    position: absolute;
		    left: 0;
		    width: auto;
		}
		#sysLogForm .sysLogInput .button {
			margin: 22px 0 0 5px;
			position: absolute;
		    right: 4px;
		    top: 0;
		}
		#sysLogForm .sysLogInput .button.tiny {
			margin: 1px 0 0 5px;
		}
		
		#sysLogForm .sysLogInput div.sysLogContent {
			margin: 0;
			float: none;
			overflow: hidden;
			margin: 0 40px 0 60px;
		}
		#sysLogForm .sysLogInput .sysLogContent .span {
			margin-left:0;
			float: left;
			width: 100%;
		}
	</style>
	
	<div class="sysLog<#if tiny> tiny</#if>">${fn.toHtml(fn.val(action, 'execute.richContent')!)}</div>

	<@s.actionerror cssClass="error"/>
	<input type="hidden" name="_type" value="${fn.modelName}"/>
	<@hidden name="tiny" value=tiny?string/>
	<@hidden name="model.id"/>
	<@hidden name="model.party.id"/>
	<@hidden name="model.eventItem.id"/>
	<@hidden name="model.event.id"/>
	<@hidden name="model.exchangeRate.id"/>
	<@hidden name="model.partItem.id"/>
	<@hidden name="model.rfqItemUser.id"/>
	<@hidden name="model.rfqItemAllocate.id"/>
	
	<div class="sysLogInput<#if tiny> tiny</#if>">
		<#if tiny>
			<@text label="sysLog.content" name="model.content" clazz="sysLogContent" />
		<#else>
			<@textarea label="sysLog.content" name="model.content" clazz="sysLogContent" height=80/>
		</#if>
		<#if tiny><#assign btnClazz="tiny"></#if>
		<#assign btnLabel = stack.findValue("getText('commons.add')")>
		<@button name="add" label="${btnLabel}" onclick="submitLog(this)" clazz=btnClazz!/>
	</div>
	
	<script>
		$(document).ready(function() {
			$('.sysLogInput input[name="model.content"]').keypress(function(event) {
				if (event.which == 13) {
					submitLog(this);
				}
			});
		});
	</script>
</@form>